AggLayer: Normalize storage slot naming#2521
Conversation
mmagician
left a comment
There was a problem hiding this comment.
Thanks for taking this on! Unfortunately I think this is one of those bike-sheddeable PRs, so let me go right at it 😁
There are some slots in bridge_config.masm, of which I think one deserves a rename (of the last component - I'd drop miden prefix from all of them as outlined in the other comments above):
const GER_STORAGE_SLOT=word("miden::agglayer::bridge::ger")
I'd change the name to indicate it's a map.
Regarding admin / ger_manager - we might want to be consistent w.r.t. this holding an account ID, similarly to bridge_id.
So maybe admin_id etc.? Alternatively, suffix all of them with _account_id instead for extra clarity.
| # Storage slots | ||
| # The slot in this component's storage layout where the bridge account ID is stored. | ||
| const BRIDGE_ID_SLOT = word("miden::agglayer::faucet") | ||
| const BRIDGE_ID_SLOT = word("miden::agglayer::bridge::id") |
There was a problem hiding this comment.
as per the docs, we should follow:
project_name::component_name::slot_name
Here, I would make two modifications:
- drop
midenaltogether (from all agglayer storage slots) - use
bridgeorfaucetdepending on which component this belongs to (e.g. particular one belongs to the faucet, but describes the bridge account ID. So overall I'd keep it asagglayer::faucet::bridge_id)
| // Fixed seed for deterministic "random" destination vectors. | ||
| // Keeping this constant ensures everyone regenerates the exact same JSON vectors. | ||
| uint256 constant VECTOR_SEED = uint256(keccak256("miden::agglayer::mmr_frontier_vectors::v2")); | ||
| uint256 constant VECTOR_SEED = uint256(keccak256("agglayer::mmr_frontier_vectors::v2")); |
There was a problem hiding this comment.
lol this change generates half the PR's diff due to regeneration of the JSON
This PR updates the AggLayer storage slot names, namely:
agglayer::bridge::admin_account_id,agglayer::bridge::ger_map,agglayer::bridge::let_frontier) removing themiden::prefix from the names, and updates component re-exports/note scripts toagglayer::*something*.build.rsto assemble the library asagglayer(instead ofmiden::agglayer) and aligns generated imports.SPEC.mdto use new names.Closes: #2356